hypervisor/xen/tools: Remove the XENMEM_get_oustanding_pages and provide the data...
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 13 May 2013 19:29:11 +0000 (15:29 -0400)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 14 May 2013 09:01:50 +0000 (10:01 +0100)
commitbec8f17e48439ee5b8370f4e431ccd9a9514bee7
tree59b77ff052dcef3826e1f54a5eb183ae5ceac18a
parentabf04cf04f5b6f2ce22e9f7966d63303b9487d81
hypervisor/xen/tools: Remove the XENMEM_get_oustanding_pages and provide the data via xc_phys_info

During the review of the patches it was noticed that there exists
a race wherein the 'free_memory' value consists of information from
two hypercalls. That is the XEN_SYSCTL_physinfo and XENMEM_get_outstanding_pages.

The free memory the host has available for guest is the difference between
the 'free_pages' (from XEN_SYSCTL_physinfo) and 'outstanding_pages'. As they
are two hypercalls many things can happen in between the execution of them.

This patch resolves this by eliminating the XENMEM_get_outstanding_pages
hypercall and providing the free_pages and outstanding_pages information
via the xc_phys_info structure.

It also removes the XSM hooks and adds locking as needed.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir.xen@gmail.com>
17 files changed:
tools/libxc/xc_domain.c
tools/libxc/xenctrl.h
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/libxl_types.idl
tools/libxl/xl_cmdimpl.c
xen/common/memory.c
xen/common/page_alloc.c
xen/common/sysctl.c
xen/include/public/memory.h
xen/include/public/sysctl.h
xen/include/xen/mm.h
xen/include/xsm/dummy.h
xen/include/xsm/xsm.h
xen/xsm/dummy.c
xen/xsm/flask/hooks.c
xen/xsm/flask/policy/access_vectors